package com.atguigu.spzx.common.exception;

import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import lombok.Data;

/**
 * 作者:hfj
 * 功能:
 * 日期: 2024/3/22 11:32
 */
@Data
public class GuiguException extends RuntimeException{

    private Integer code; //异常状态码
    private String message;//异常信息

    private ResultCodeEnum resultCodeEnum;

    public GuiguException(ResultCodeEnum resultCodeEnum){
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
